#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
#define rep(i, a, b) for (int i = (a); i <= (b); i++)
#define per(i, a, b) for (int i = (a); i >= (b); i--)
#define endl '\n'
const int N = 5e4 + 5;

int n, m;
int vis[N], primes[N], tot;
void init(int n) {
  vis[1] = 1;
  rep(i, 2, n) {
    if (!vis[i]) primes[++tot] = i;
    rep(j, 1, tot) {
      ll k = 1ll * primes[j] * i;
      if (k > n) break;
      vis[k] = 1;
      if (i % primes[j] == 0) break;
    }
  }
}
set<int> res;
bool is_prime(int x) {
  if (x < 2) return false;
  for (int i = 2; 1ll * i * i <= x; i++)
    if (x % i == 0) return false;
  return true;
}
void dfs(int s, int ans, int r) {
  if (r == 1) {
    res.insert(ans);
    return;
  }
  if (r > primes[s] && is_prime(r - 1)) res.insert(ans * (r - 1));
  for (int i = s; 1ll * primes[i] * primes[i] <= r; i++) {
    ll x = 1, y = primes[i];
    while (x + y <= r) {
      x += y;
      if (r % x == 0) dfs(i + 1, ans * y, r / x);
      y *= primes[i];
    }
  }
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  init(5e4);
  while (cin >> n) {
    res.clear();
    dfs(1, 1, n);
    cout << res.size() << endl;
    for (int x : res) cout << x << ' ';
    cout << endl;
  }
  return 0;
}
